import {useDispatch, useSelector} from "react-redux";
import {fechChannelList} from "../store/modules/channel";

export default function ReduceComponent() {
    const config = useSelector((state) => state.countStore)
    const config1 = useSelector((state) => state.channelStore)
    console.log(config1, 'config1')
    const dispath = useDispatch()
    const add = () => {
    }
    const down = () => {
    }
    const sendNetWork = () => {
        dispath(fechChannelList())
    }
    return (
        <div>
            <div>Reduce</div>
            <button onClick={add}>+</button>
            <button onClick={down}>-</button>
            <div>{config.userName}</div>
            <div>{config.age}</div>
            <div>{config.count}</div>
            <button onClick={sendNetWork}>点击发送数据</button>
            <div>{config1.channelList.map((item) => <div key={item.id}>{item.name}</div>)}</div>
            {/*<button onClick={()=>dispatch(addNum(100))}>ADDS</button>*/}
        </div>
    )
}
